<template>
	<!--车次日志-->
	<div>
		<view style="position: relative;display: flex;flex-direction: row;align-items: center;padding: 12px 10px;font-weight: 400;">
			<view style="width: 4px;height: 12px;border-radius: 10px;background-color: #2979ff;margin-right: 6px"></view>
			<view style="display: flex;flex-direction: column;flex: 1;color: #333;">车次日志</view>
		</view>
		<view v-if="list.length>0">
			<uni-steps :options="stepsList" active-color="#007AFF" :active="0" direction="column" />
			<view style="height: 100px;"></view>
		</view>
		<view v-else>
			<image src="../../../static/none.png" style="height: 260px;width: 260px;display: block;margin: 0 auto;padding-top: 50px;"></image>
			<view style="display: flex;justify-content: center;align-items: center;">
				暂无车次日志
			</view>
		</view>
	</div>
</template>

<script>
	import {
		scheduleCarlogList
	} from '@/api/system/dispatch.js'
	export default {
		props: {
			scheduleId:{
				type: String,
				default:''
			}
		},
		data() {
			return {
				list:[],
				stepsList:[],
				scheduleId_:'',
			}
		},
		watch: {
			scheduleId:{
			    handler(newVal,oldVal){
					if(newVal)
					{
						this.scheduleId_=newVal
						//this.getList()
					}
			    },
				deep:true,
				immediate:true
			}
		},
		methods: {
			async getList() {
				uni.showLoading({
					title: '正在加载',
				})
				await scheduleCarlogList(this.scheduleId_).then(res => {
					uni.hideLoading()
					if (res.code == '200') {
						this.list = res.data||[]
						this.stepsList=this.list.map(item=>{
							return {
								title:item.operatePhone+'操作：'+item.logMsg,
								desc:item.timeLoad
							}
						})
					} else {
						uni.showToast({
							icon: 'none',
							title: res.msg
						})
					}
				})
			},
		},
	}
</script>

<style scoped>

</style>